#ifndef BIT_WIN_BIT_RANGE_H
#define BIT_WIN_BIT_RANGE_H


namespace BitWin
{


// Range minimalistic class.
// Defines unsigned begin (inclusive) and end (exclusive) range points.
// Begin point is guaranteed to be less than or equal to end point.
class BitRange
{
    unsigned _begin;
    unsigned _end;

public:

    // Default parameterless constructor creates null-length range
    // (null range).
    BitRange();

    // Create valid range.
    // Range is [a, b) if a < b
    //          [b, a] otherwise
    BitRange(unsigned a, unsigned b);

    unsigned begin() const;
    unsigned end() const;
    unsigned length() const;
};


}; // BitWin namespace end


#endif
